#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:= hiswi_rootfs
KG_VERSION:=1.0
PKG_RELEASE:=1
TARGET_LDFLAGS +=
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/hiswi_rootfs
    SECTION:=net
    CATEGORY:=Network
    SUBMENU:=mine
    MAINTAINER:=hiswi_rootfs
    TITLE:=HiSWi ROOTFS
    DEPENDS:=
endef

define Package/hiswi_rootfs/description
	[ hiswi_rootfs ] hiswi rootfs
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)
endef

define Package/hiswi_rootfs/install
	$(INSTALL_DIR) $(1)
	$(CP) ./files/* $(1)/
endef

define Package/hiswi_rootfs/preinst
	dev_name=$(uname -a | awk '{print $2}'| tr -d '\n')
	if [ $dev_name="HiSWi" -o $dev_name="OpenWrt" -o $dev_name="MP18" ];then
		echo "preinst"
	fi
endef

define Package/hiswi_rootfs/postinst
	dev_name=$(uname -a | awk '{print $2}'| tr -d '\n')
	if [ $dev_name="HiSWi" -o $dev_name="OpenWrt" -o $dev_name="MP18" ];then
		echo "postinst"
	fi
endef

$(eval $(call BuildPackage,hiswi_rootfs))
